package com.example.back.service.impl;

import com.example.back.entity.Book;
import com.example.back.mapper.BookMapper;
import com.example.back.service.BookService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServieImpl implements BookService {
    @Autowired
    private BookMapper bookMapper;
    @Override
   public PageInfo<Book> findAllBooks(int page, int limit, String name) {
        PageHelper.startPage(page,limit);
        List<com.example.back.entity.Book> list = bookMapper.findAll(name);
        return new PageInfo<>(list);
    }
}
